<div id="maincontent">
    <div id="regiser-recovered">
        <div class="left">
            <h1>Create Account Page</h1>
            <form action="<?php echo $this->baseUrl()?>/register" method="POST" id="form-create-account" onsubmit="return valid();">
                <div class="note"><p>Quisque commodo venenatis arcu, non volutpat arcu lobortis at. Donec vel turpis non erat luctus ultrices vel sed massa.</p></div>
                <div class="error1" style="color:red"></div>
                <?php if($this->msg):?>
                    <p style="color:blue"><?php echo $this->msg;?></p>
                <?php endif;?>
                <p class="create">
                    <label class="first">First Name</label>
                    <label class="first last">Last Name</label>
                </p>
                <p class="create">
                    <input type="text" class="inputbox" name="first_name" onfocus="if (this.value=='Your first name...') this.value='';" onblur="if (this.value=='') this.value='Your first name...';" value="Your first name..."/>
                    <input type="text" class="inputbox last" name="last_name" onfocus="if (this.value=='Your last name...') this.value='';" onblur="if (this.value=='') this.value='Your last name...';" value="Your last name..."/>
                </p>
                <p class="create">
                    <label class="first">Email Address</label>
                    <label class="first last">Address</label>
                </p>
                <p class="create">
                    <input type="text" class="inputbox" name="email1" onfocus="if (this.value=='Your email...') this.value='';" onblur="if (this.value=='') this.value='Your email...';" value="Your email..."/>
                    <input type="text" class="inputbox last" name="address" onfocus="if (this.value=='Your address...') this.value='';" onblur="if (this.value=='') this.value='Your address...';" value="Your address..."/>
                </p>
                <p class="create">
                    <label class="first">Password</label>
                    <label class="first last">Confirm Password</label>
                </p>
                <p class="create">
                    <input type="password" class="inputbox" name="password1" />
                    <input type="password" class="inputbox last" name="re-password" />
                </p>
                <p><input type="submit" class="submit" name="registration" value="Complete Registration"/></p>
                
            </form>
        </div>
        <div class="right">
            <h4>Some Tips</h4>
            <ul class="list-tips">
                <li class="row1"><a href="#" title="">Registration is free</a></li>
                <li class="row2"><a href="#" title="">100% Secured</a></li>
                <li class="row3"><a href="#" title="">24 Hours online support</a></li>
                <li class="row4"><a href="#" title="">Customizable</a></li>
                <li class="row5"><a href="#" title="">Share your pic</a></li>
                <li><p>Ut diam arcu, dictum ut vulputate sed, iaculis nec lorem. Fusce pharetra nisl vitae nisl ultricies ut malesuada leo fringilla.</p></li>
            </ul>
        </div>
        <div class="clearfix"></div>
    </div>
</div>
<script type="text/javascript">
function valid(){
    var baseUrl = '<?php echo $this->baseUrl();?>';
    var first_name = $('input[name=first_name]').val();
    var last_name = $('input[name=last_name]').val();
    var email = $('input[name=email1]').val();
    var address = $('input[name=address]').val();
    var password = $('input[name=password1]').val();
    var repassword = $('input[name=re-password]').val();
    var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
    
    if(first_name == 'Your first name...' || last_name == 'Your last name...' || email == 'Your email...' || address == 'Your address...' || password == '' || repassword == ''){
        $('.error1').html('<p>Please input all field</p>');
        return false;
    }

    if ( password != repassword ) {
        $('.error1').html('<p>Password is not match</p>');
        return false;
    }
    
    if ( !emailReg.test( email ) ) {
        $('.error1').html('<p>Invalid email</p>');
        return false;
    }
}
</script>